package com.boolib.shopweb.web;

import com.boolib.bo.ProductBO;
import com.boolib.commons.entity.ServerResponse;
import com.boolib.service.IProductService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.*;

@RestController
public class ProductController {


    @Autowired
    private IProductService productService ;

    @PostMapping("/proAdd")
    public ServerResponse add(@RequestBody ProductBO productBO){

        return  productService.addProduct(productBO,"ss");
    }


    @GetMapping("/q/{id}")
    public ServerResponse queryInfo(@PathVariable(value = "id") Integer productId){

        return productService.queryProductInfoById(productId);
    }


}
